/*
 * Copyright 2010-2012 Susanta Tewari. <freecode4susant@users.sourceforge.net>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package factory.genomemap;

import genomemap.data.ClonePool;
import genomemap.data.ComplementationData;
import genomemap.data.GeneCloneTagDAO;
import genomemap.data.HybridDataPool;
import genomemap.tagging.ComplementationTaginStrategy;
import genomemap.tagging.HybridizationTaginStrategy;
import genomemap.tagging.SeqTaggingStrategy;
import genomemap.tagging.TaggingStrategy;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author stewari1
 */
public class TaggingFileFactory implements TaggingFactory {

    public TaggingStrategy getSeqTaggingStrategy() {

        SeqTaggingStrategy seqTaggingStrategy = new SeqTaggingStrategy();

        return seqTaggingStrategy;
    }

    public TaggingStrategy getComplementationTaggStrategy() {

        ComplementationTaginStrategy complementationTaggStrategy = null;

        try {

            GeneCloneTagDAO geneCloneTagDAO =
                FactoryManager.getInstance().getDAOFactory().getGeneCloneTagDAO();

            complementationTaggStrategy =
                new ComplementationTaginStrategy(geneCloneTagDAO.getComplementationData());

        } catch (Exception ex) {
            Logger.getLogger(TaggingFileFactory.class.getName()).log(Level.SEVERE, null, ex);
        }

        return complementationTaggStrategy;
    }

    public TaggingStrategy getHybridizationTaginStrategy() {

        HybridizationTaginStrategy hybridizationTaginStrategy = null;

        try {

            ComplementationData compl_data =
                FactoryManager.getInstance().getDAOFactory().getGeneCloneTagDAO()
                    .getComplementationData();
            ClonePool clonePool           = new ClonePool();
            HybridDataPool hybridDataPool = new HybridDataPool();

            hybridizationTaginStrategy = new HybridizationTaginStrategy(compl_data, clonePool,
                    hybridDataPool);

        } catch (Exception ex) {
            Logger.getLogger(TaggingFileFactory.class.getName()).log(Level.SEVERE, null, ex);
        }

        return hybridizationTaginStrategy;
    }
}
